use craftdig_math::SubchunkPos;

/// Represents some generic data structure that has a cell for each position in
/// a chunk, permitting lookups with any [``SubchunkPos``].
pub trait ChunkTable {
    type Value;

    /// Gets a clone of the value at a position.
    fn get_clone(&self, pos: SubchunkPos) -> Self::Value;

    /// Sets the value at a position, returning a previous value.
    fn set_swap(&mut self, pos: SubchunkPos, v: Self::Value) -> Self::Value;
}
